<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
			    xmlns:ui="http://java.sun.com/jsf/facelets"
			    xmlns:h="http://java.sun.com/jsf/html"
			    xmlns:f="http://java.sun.com/jsf/core"    
			    template="./template/template_login.xhtml">
    
    <ui:define name="title">
        Registrar Egreso
    </ui:define>
    
    <ui:define name="content">    				
			    		    			    	
 	<div class="box box-50 altbox">
		<div class="boxin">
			<div class="header">
				<h3>Egresos</h3>
			</div>
			<h:form id="agregarEgresoForm" styleClass="fields"> 				
				<fieldset class="last">
					<f:event listener="#{expensesBean.validateExpensesForm}" type="postValidate" />					
					<legend><strong>Agregar Egreso</strong></legend>
					<h:messages id="messages" errorClass="msg msg-error" infoClass="msg msg-info" />
					
					<h:outputLabel value="Importe:" />
					<h:inputText id="importeId" value="#{expensesBean.expensesView.amount}"  onfocus="this.select();" onkeydown="return (numeric(event, 1) &amp;&amp; noPaste(event, this));" onkeyup="extractNumber(this,2,false);" />
					
					<h:outputLabel value="Tipo de Egreso:" />					
					<h:selectOneMenu id="egresoId" value="#{expensesBean.expensesView.expensesItemView.id}" >
	  						<f:selectItems value="#{expensesBean.expensesItems}" />
					</h:selectOneMenu>
										
					<h:outputLabel value="Proveedor:" />
					<h:selectOneMenu id="proveedorId" value="#{expensesBean.expensesView.suppliersView.provId}" >
	  						<f:selectItems value="#{expensesBean.suppliersList}" />
					</h:selectOneMenu>
					
					<h:outputLabel value="Comentarios:" />					
					<h:inputTextarea styleClass="campo_texto" value="#{expensesBean.expensesView.comments}"  onfocus="this.select();" cols="40" rows="5" />					
					
					<div class="sep">
						<h:commandButton id="back" styleClass="button" value="Regresar" action="#{receiptsBean.backAction}" immediate="true" />&nbsp;&nbsp;
						<h:commandButton id="submit" styleClass="button altbutton" value="Guardar" action="#{expensesBean.addExpensesAction}" /> 		      											
					</div>
			</fieldset>
			</h:form>
		</div>
	</div>    			    			    			    				    												
	</ui:define>
    
</ui:composition>